#include<iostream>
#include<string>
#include<vector>
#include<functional>

void print(const std::string& str)
{
    std::cout<<str<<std::endl;
}

int main()
{
    using task=std::function<void(std::string)>;
    std::vector<task> array;//任务数组
    task func=std::bind(print,std::placeholders::_1);
    array.push_back(func);

    func("lijinpeng");
    array[0]("lijinpeng");
    return 0;
}